package com.yuw.oop.overridedemo;

public class Student extends Person {
	// 属性
	private String stuNo;
	// 子类定义一个同名的属性：覆盖了父类同名的属性
	private String perName = "小小明";
	// 行为
	/**
	 * 新扩展：学习行为
	 */
	public void doStuding() {
		System.out.println(this.getPerName() + " is studing...");
	}
		
	@Override
	public void doEating() {
		// 属性的覆盖
		System.out.println(this.perName + " is eating...,from sub class");
		super.doEating();
	}




	public String getPerName() {
		return perName;
	}


	public void setPerName(String perName) {
		this.perName = perName;
	}


	public String getStuNo() {
		return stuNo;
	}

	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}

}
